home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 1 / CU Amiga Magazine CD-ROM Special Edition (1995)(EMAP Images)(GB)[Issue 1995-11].iso / Aminet / biz / demo / StylusDemo.lha / Stylus_Demo / REXX / LayerSel.pvrx < prev    next >
Text File  |  1993-07-22  |  929b  |  41 lines

  1. /* LayerSel.pvrx --- Select all objects in layer */
  2.  
  3. /*
  4. call open STDOUT,"RAM:RxOut.txt",W
  5. call open STDERR,"RAM:RxErr.txt",W
  6. trace R
  7. */
  8.  
  9. /* Try to get exclusive lock on project window.
  10.     If can't get lock, not polite to interrupt. */
  11. 'Lock Wait'
  12. if rc ~= 0 then exit
  13.  
  14. options results
  15.  
  16. /* Prompt user for layer name */
  17. 'GetStr "Select Layer: name" "OK" "CANCEL"' /* longest prompt 44 chars */
  18. LayerName = result
  19. if rc ~= 0 | LayerName = "" then do
  20.     'UnLock'
  21.     exit 
  22. end
  23.  
  24. /*** DOESN'T TEST FOR EXISTENCE OF LAYERS ***/
  25.  
  26. /* Select all objs in layer */
  27. 'FirstObj' LayerName; Objs.0 = result
  28. 'SelectObj' Objs.0
  29. do i = 1 until rc ~= 0    /* rc~=0 proper test for end of list? */
  30.     j = i - 1
  31.     'NextObj' Objs.j; Objs.i = result
  32.     'SelectObj' Objs.i
  33. end
  34.  
  35. CLEANUP:
  36. /* Render the area operated upon, and free the project window
  37.     This sequence is recommended to finish up most macros */
  38. /* 'Repair' */    /*Shouldn't need repair...? */
  39. 'UnLock'
  40. exit
  41.